package com.ews.onlineexchange.controller.activitii;

import java.awt.image.BufferedImage;
import java.io.InputStream;
import java.util.List;

import org.activiti.bpmn.model.BpmnModel;
import org.activiti.image.impl.DefaultProcessDiagramGenerator;

public class CustomProcessDiagramGenerator extends DefaultProcessDiagramGenerator {
	protected String	activityFontName	= "宋体";
	protected String	labelFontName		= "宋体";
	protected String	annotationFontName	= "宋体";

	public CustomProcessDiagramGenerator( final double scaleFactor ) {
		super( scaleFactor );
	}

	public CustomProcessDiagramGenerator() {
		super();
	}

	@Override
	public InputStream generateDiagram( BpmnModel bpmnModel, String imageType, List<String> highLightedActivities,
			List<String> highLightedFlows, String activityFontName, String labelFontName, String annotationFontName,
			ClassLoader customClassLoader, double scaleFactor ) {
		return super.generateDiagram( bpmnModel, imageType, highLightedActivities, highLightedFlows, this.activityFontName,
				this.labelFontName, this.annotationFontName, customClassLoader, scaleFactor );
	}

	@Override
	public BufferedImage generateImage( BpmnModel bpmnModel, String imageType, List<String> highLightedActivities,
			List<String> highLightedFlows, double scaleFactor ) {

		return generateImage( bpmnModel, imageType, highLightedActivities, highLightedFlows, this.activityFontName,
				this.labelFontName, this.annotationFontName, null, scaleFactor );
	}

}